package com.jzo2o.customer.controller.worker;

import com.jzo2o.common.utils.UserContext;
import com.jzo2o.customer.model.dto.request.WorkerCertificationAuditAddReqDTO;
import com.jzo2o.customer.service.IWorkerCertificationAuditService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;

/**
 * @Description WorkerAuditController
 * @Author jzh
 * @Date 2025-08-06  17:12
 */

@Slf4j
@RestController("workerWorkerCertificationAuditController")
@RequestMapping("/worker/worker-certification-audit")
@Api(tags = "服务端 - 服务人员认证审核相关接口")
public class WorkerCertificationAuditController  {

    @Resource
    private IWorkerCertificationAuditService workerCertificationAuditService;

    @ApiOperation("服务人员提交认证审核申请")
    @PostMapping
    public void auditSubmit(@RequestBody WorkerCertificationAuditAddReqDTO workerCertificationAuditAddReqDTO){
        workerCertificationAuditAddReqDTO.setServeProviderId(UserContext.currentUserId());
        workerCertificationAuditService.auditSubmit(workerCertificationAuditAddReqDTO);
    }

    @GetMapping("/rejectReason")
    @ApiOperation("查询最新的驳回原因")
    public Map<String, String> rejectReason(){ // todo 返回值封装 RejectReasonResDTO
        return workerCertificationAuditService.rejectReason();
    }
}
